package com.dongdongshop.controller;

import com.dk.data.R;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.TsellerService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
//商家管理
@Controller
@RequestMapping("sell")
public class TbsellerController {


    @DubboReference
    TsellerService ts;


    //页面跳转
    @RequestMapping("tiao")
    public String tiao(){
        return "admin/seller";
    }



    //查询全部
    @RequestMapping("getall")
    @ResponseBody
    public R<List<TbSeller>> getall(){
        List<TbSeller> ls = ts.getall();
        return R.ok().setData(ls);
    }


    //根据id查询
    @RequestMapping("byid")
    @ResponseBody
    public R<TbSeller> byid(String sellerId){
        TbSeller tbseller = ts.byid(sellerId);
        return R.ok().setData(tbseller);
    }


    //审核通过
    @RequestMapping("tongguo")
    @ResponseBody
    public R tongguo(TbSeller tsr){
        ts.upTong(tsr);
        return R.ok();
    }



}
